﻿using System;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Ink;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;
using nyxwin.Main.Base.ViewModels;

namespace nyxwin.Main.ViewModel.SubModels
{
    public class FriendViewModel : BaseViewModel
    {
        private Data.Friends.Friend x;

        public FriendViewModel(Data.Friends.Friend x)
        {
            this.Nick = x.Nick;
            this.NickImageUrl = x.NickImageUrl;

            if (x.Active != null)
                this.Active = new ActiveViewModel(x.Active);
            else
                this.Active = null;
        }
        public override void Unload()
        {
            base.Unload();

            if (Active != null)
                Active.Unload();
        }

        public string Nick { get; private set; }
        public Uri NickImageUrl { get; private set; }

        public ActiveViewModel Active { get; private set; }
        public Visibility ActiveVisibility { get { return (Active != null) ? Visibility.Visible : Visibility.Collapsed; } }
    }
}
